package com.zhuss.common;

import java.math.BigDecimal;

import com.zhuss.enums.BannerType;
import com.zhuss.enums.CompanyType;
import com.zhuss.enums.ComplaintType;
import com.zhuss.enums.CreamType;
import com.zhuss.enums.DiningType;
import com.zhuss.enums.DrinkType;
import com.zhuss.enums.EnumUtil;
import com.zhuss.enums.Floor;
import com.zhuss.enums.Floor2;
import com.zhuss.enums.FoodTime;
import com.zhuss.enums.HavingStandard;
import com.zhuss.enums.IsEnum;
import com.zhuss.enums.OpusType;
import com.zhuss.enums.OrderStatus;
import com.zhuss.enums.ProductType;
import com.zhuss.enums.ProposalStatus;
import com.zhuss.enums.PublishStatus;
import com.zhuss.enums.PublishTimeType;
import com.zhuss.enums.RequestMethod;
import com.zhuss.enums.ResourceType;
import com.zhuss.enums.RoleType;
import com.zhuss.enums.StartStopEnum;
import com.zhuss.enums.SystemEnum;
import com.zhuss.enums.TopicLevel;
import com.zhuss.enums.UpperDownEnum;
import com.zhuss.util.DateUtil;
import com.zhuss.util.NoUtil;

public interface BaseVo {
	
	default String dateStrOnlyMinute(Long date) {
		return DateUtil.toDateTimeStrOnlyMinute(date);
	}
	
	default String subNo(String no) {
		return NoUtil.simpleNo(no);
	}
	
	default String resourceTypeName(Integer type) {
		return EnumUtil.containsKey(ResourceType.class, type);
	}
	
	default String systemName(Integer system) {
		return EnumUtil.containsKey(SystemEnum.class, system);
	}
	
	default String requestMethodName(Integer requestMethod) {
		return EnumUtil.containsKey(RequestMethod.class, requestMethod);
	}
	
	default String isName(Integer is) {
		return EnumUtil.containsKey(IsEnum.class, is);
	}
	
	default String startStopStatusName(Integer status) {
		return EnumUtil.containsKey(StartStopEnum.class, status);
	}
	
	default String roleTypeName(Integer type) {
		return EnumUtil.containsKey(RoleType.class, type);
	}
	
	/*default String areaName(Integer area) {
		return EnumUtil.containsKey(com.zhuss.enums.Area.class, area);
	}*/
	
	default String companyTypeName(Integer companyType) {
		return EnumUtil.containsKey(CompanyType.class, companyType);
	}
	
	default String productTypeName(Integer productType) {
		return EnumUtil.containsKey(ProductType.class, productType);
	}
	
	default String productTimeName(Integer productTime) {
		return EnumUtil.containsKey(FoodTime.class, productTime);
	}
	
	default String floorName(Integer floor) {
		String floorName = EnumUtil.containsKey(Floor.class, floor);
		if (floorName == null || "".equals(floorName)) {
			floorName = EnumUtil.containsKey(Floor2.class, floor);
		}
		return floorName;
	}
	
	default String statusNameProduct(Integer status) {
		return EnumUtil.containsKey(UpperDownEnum.class, status);
	}
	
	default String diningTypeName(Integer diningType) {
		return EnumUtil.containsKey(DiningType.class, diningType);
	}
	
	default String statusNameOrder(Integer status) {
		return EnumUtil.containsKey(OrderStatus.class, status);
	}
	
	default String topicLevelName(Integer level) {
		return EnumUtil.containsKey(TopicLevel.class, level);
	}
	
	default String foodTimeName(Integer foodTime) {
		return EnumUtil.containsKey(FoodTime.class, foodTime);
	}
	
	default String havingStandardName(Integer havingStandard) {
		return EnumUtil.containsKey(HavingStandard.class, havingStandard);
	}
	
	default String drinkTypeName(Integer drinkType) {
		return EnumUtil.containsKey(DrinkType.class, drinkType);
	}

	default String publishStatusName(Integer status) {
		return EnumUtil.containsKey(PublishStatus.class, status);
	}

	default String proposalStatusName(Integer status) {
		return EnumUtil.containsKey(ProposalStatus.class, status);
	}

	default String publishTimeType(Integer timeStatus) {
		return EnumUtil.containsKey(PublishTimeType.class, timeStatus);
	}

	default String complaintStatus(Integer status) {
		return EnumUtil.containsKey(ComplaintType.class, status);
	}
	
	default String priceName(Long price) {
		return new BigDecimal(price).divide(new BigDecimal(100l)) + "";
	}
	
	default String opusTypeName(Integer opusType) {
		return EnumUtil.containsKey(OpusType.class, opusType);
	}
	
	default String creamName(Integer cream) {
		return EnumUtil.containsKey(CreamType.class, cream);
	}
	
	default String keyWordTypeName(Integer type) {
		return EnumUtil.containsKey(BannerType.class, type);
	}
}
